<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:p="http://primefaces.org/ui"
      xmlns:h="http://xmlns.jcp.org/jsf/html">

    <h:head>
    </h:head>
    <h:body>
        <h:form id="form">

            <p:dataTable id="datatable" value="#{dataTable035.cars}" var="car"
                         multiViewState="true" rows="4" paginator="true"
                         rowKey="#{car.number}" selection="#{dataTable035.selectedCar}"
                         lazy="false">

                <p:ajax event="rowSelect" process="@this" />
                
                <p:column headerText="Number">
                    <h:outputText id="number" value="#{car.number}" />
                    <p:commandButton id="select" value="Select" process="@this" update="@form">
                        <f:setPropertyActionListener value="#{car}" target="#{dataTable035.selectedCar}" />
                    </p:commandButton>
                </p:column>

                <p:column headerText="Car Name">
                    <h:outputText id="name" value="#{car.name}" />
                    
                </p:column>

            </p:dataTable>

        </h:form>
    </h:body>
</html>
